<?php
use Common\Utils\WeChatUtils;

require_once './Application/Common/Utils/WeChatUtils.class.php';
$wechat = new WeChatUtils('wx41cc838b916e5f4c','4ba4f5005f3bd685a797181b84bbc776','gouhuiwan');
//$result = $we_chat->createMenu($menu);
$menu = <<<JSON
{


    "button": [
        {
            "name": "集品商城",
            "sub_button":[
           {	
               "type":"view",
               "name":"集品首页",
               "url":"http://www.jipintc.com/"
            }]
        },
        {
        "name": "分享赚钱",
        "sub_button":[
        {
            "name": "分享赚钱",
            "type": "view",
            "url" : "http://www.jipintc.com/Home/WeChat/login/user_id/1/url/QRCode"
        },
          {
            "name": "加入代理",
            "type": "view",
            "url" : "http://www.jipintc.com/Home/WeChat/login/user_id/1/url/agentUI"
        }
        ]
        },
        {
            "name": "我的服务",
            "sub_button":[
              {	
               "type":"view",
               "name":"个人中心",
               "url":"http://www.jipintc.com/Home/Me"
            },
           {	
               "type":"view",
               "name":"购买记录",
               "url":"http://www.jipintc.com/Home/WeChat/login/user_id/1/url/Order"
            },
            {	
               "type":"view",
               "name":"分享赚钱",
               "url":"http://www.jipintc.com/Home/WeChat/login/user_id/1/url/QRCode"
            },
            {	
               "type":"view",
               "name":"常见问题",
               "url":"http://www.jipintc.com/Home/WeChat/login/user_id/1/url/Problem"
            }]
     }
    ]
    
}
JSON;
$wechat->deleteMenu();
$result = $wechat->createMenu($menu);
var_dump($result);
//phpinfo();